from PyQt5.QtWidgets import QDialog, QVBoxLayout, QTextEdit
from PyQt5.QtCore import Qt


class ErrorMsg(QDialog):
    def __init__(self, errmsg):
        super().__init__()
        self.setGeometry(200, 200, 300, 200)
        self.setWindowTitle('错误提示')
        self.setWindowFlag(Qt.WindowStaysOnTopHint)
        layout = QVBoxLayout()
        label = QTextEdit()
        for i in errmsg:
            label.append(i)
        layout.addWidget(label)
        self.setLayout(layout)
        self.showNormal()


class InfoMsg(QDialog):
    def __init__(self, info):
        super().__init__()
        self.setGeometry(200, 200, 300, 200)
        self.setWindowTitle('一般提示')
        self.setWindowFlag(Qt.WindowStaysOnTopHint)
        layout = QVBoxLayout()
        label = QTextEdit()
        label.append(info)
        layout.addWidget(label)
        self.setLayout(layout)
        self.showNormal()
